<%--
  Created by IntelliJ IDEA.
  User: aaa
  Date: 2017/5/17
  Time: 9:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file=".././common/taglibs.jsp" %>
<core:set var="ctx" value="${pageContext.request.contextPath}"/>
<html>
<head>
    <title>Title</title>
    <script src="${ctx}/js/views/payment/outlineOrderApp.js"></script>
    <script src="${ctx}/js/views/common/big.min.js"></script>
</head>
<body ng-app="myApp" style="overflow:scroll;overflow-x:hidden">
<core:import url="../common/pageHead.jsp">
    <core:param name="title" value="反录信息查询"/>
</core:import>
<div ng-controller="queryCtrl" class="container-fluid">
    <form id="queryForm" name="queryForm" action="${ctx}/payment/searchPaymentBatchList" autocomplete="off">
        <table class="table table-bordered table-condensed">
            <tr>
                <td class="text-right">
                    订单号
                </td>
                <td>
                    <input type="text" ng-model="vm.queryBean.orderNo" class="{{vm.constant.inputClass}}">
                </td>
                <td class="text-right">
                    录入开始日期
                </td>
                <td>
                    <input type="text" class="{{vm.constant.inputClass}}" uib-datepicker-popup="yyyy-MM-dd"
                           ng-model="vm.queryBean.beginDate"/>
                </td>
                <td class="text-right">
                    录入结束日期
                </td>
                <td>
                    <input type="text" class="{{vm.constant.inputClass}}" uib-datepicker-popup="yyyy-MM-dd"
                           ng-model="vm.queryBean.endDate"/>
                </td>
            </tr>
            <tr>
                <td class="text-right">
                    商户号
                </td>
                <td>
                    <input type="text" ng-model="vm.queryBean.merchantCode" class="{{vm.constant.inputClass}}"
                           placeholder="根据简称获取商户代码"
                           typeahead-min-length="0"
                           uib-typeahead="item.key as item.value for item in vm.getCache('MERCHANT_CODE') | filter:$viewValue | limitTo:10">
                </td>
                <td class="text-right">
                    银行请求流水
                </td>
                <td>
                    <input type="text" ng-model="vm.queryBean.payRepNo" class="{{vm.constant.inputClass}}">
                </td>
                <td class="text-right">
                    原订单号
                </td>
                <td>
                    <input type="text" ng-model="vm.queryBean.oldOrderNo" class="{{vm.constant.inputClass}}">
                </td>
            </tr>
            <tr>
                <td class="text-right">
                    状态
                </td>
                <td>
                    <select ng-model="vm.queryBean.status" class="{{vm.constant.inputClass}}">
                        <option value="">请选择</option>
                        <option value="01">初始</option>
                        <option value="02">已审核</option>
                        <option value="03">成功</option>
                        <option value="04">失败</option>
                        <option value="05">废弃</option>
                    </select>
                </td>
                <%--<td class="text-right">
                    处理开始日期
                </td>
                <td>
                    <input type="text" class="{{vm.constant.inputClass}}" uib-datepicker-popup="yyyy-MM-dd"
                           ng-model="vm.queryBean.operateBeginDate"/>
                </td>
                <td class="text-right">
                    处理结束日期
                </td>
                <td>
                    <input type="text" class="{{vm.constant.inputClass}}" uib-datepicker-popup="yyyy-MM-dd"
                           ng-model="vm.queryBean.operateEndDate"/>
                </td>--%>
            </tr>
            <tr align="center">
                <td colspan="6">
                    <button type="button" ng-click="vm.queryDetail()" class="btn btn-default">查询</button>
                    <button type="button" ng-click="vm.resetForm()" class="btn btn-default">重置</button>
                </td>
            </tr>
        </table>
    </form>

    <div>
        <p class="btn-group">
            <shiro:hasPermission name="outline-order_add">
                <button ng-click="vm.addItem()"><i class="glyphicon glyphicon-plus"></i></button>
            </shiro:hasPermission>
            <shiro:hasPermission name="outline-order_update">
                <button ng-click="vm.updateItem()"><i class="glyphicon glyphicon-pencil"></i></button>
            </shiro:hasPermission>
        </p>
        <table table-detail>
            <thead>
            <tr>
                <th><input type="checkbox" ng-model="_checkedAll" checkbox-all="vm.pagination.list"></th>
                <th>商户号</th>
                <th>订单号</th>
                <th>订单日期</th>
                <th>渠道</th>
                <th>订单金额(元)</th>

                <th>录入状态</th>

                <th>交易类型</th>
                <th>支付机构</th>
                <th>银行类型</th>
                <th>支付请求流水</th>
                <th>支付响应流水</th>
                <th>银行账号</th>
                <th>银行账号名称</th>
                <th>银行清算日期</th>
                <th>原订单号</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody ng-repeat="bean in vm.pagination.list track by $index">
            <tr>
                <td><input name="check" type="checkbox" ng-model="bean._checked"></td>
                <td>{{vm.cached.MERCHANT_CODE[bean.merchantCode]}}({{bean.merchantCode}})</td>
                <td>{{bean.orderNo}}</td>
                <td>{{bean.orderDate | date:"yyyy-MM-dd HH:mm:ss"}}</td>
                <td>{{vm.cached.CONN_CHANNEL[bean.channel]}}</td>
                <td>{{bean.orderAmt/100 | currency: ''}}</td>

                <td>{{{'01':'初始','02':'已审核','03':'成功','04':'失败','05':'废弃'}[bean.status]}}</td>

                <td>{{bean.transCode}}</td>
                <td>{{bean.payOrgCode}}</td>
                <td>{{vm.cached.SUB_BANK_TYPE[bean.bankType]}}</td>
                <td>{{bean.payRepNo}}</td>
                <td>{{bean.payRespNo}}</td>

                <td>{{bean.bankAccId}}</td>
                <td>{{bean.bankAccName}}</td>
                <td>{{bean.paySettleDate | date:"yyyy-MM-dd"}}</td>
                <td>{{bean.oldOrderNo}}</td>

                <td>
                    <div ng-show="bean.status == '01'">
                        <shiro:hasPermission name="outline-order_audit">
                            <button class="btn btn-default" ng-click="vm.audit(bean.id)">审核成功</button>
                        </shiro:hasPermission>
                    </div>
                    <div ng-show="bean.status == '01'">
                        <shiro:hasPermission name="outline-order_audit">
                            <button class="btn btn-default" ng-click="vm.discard(bean.id)">审核失败</button>
                        </shiro:hasPermission>
                    </div>
                    <div ng-show="bean.status == '04'">
                        <shiro:hasPermission name="outline-order_audit">
                            <button class="btn btn-default" ng-click="vm.audit(bean.id)">再次发送</button>
                        </shiro:hasPermission>
                    </div>
                    <div ng-show="bean.status == '04'">
                        <shiro:hasPermission name="outline-order_audit">
                            <button class="btn btn-default" ng-click="vm.discard(bean.id)">放弃</button>
                        </shiro:hasPermission>
                    </div>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
    <core:import url="../common/pageFoot.jsp"/>
</div>
<core:import url="../common/nav.jsp"/>
</body>
</html>

